package com.morty.user.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@Api(value = "Git代码提交量API", tags = {"Git代码提交量API"})
@Component
@FeignClient(name = "management", path="/management/git", contextId = "GitlubControllerApi")
public interface GitlubControllerApi {

    @ApiOperation(value = "查询Git代码提交量")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "privateToken", value = "privateToken", paramType = "query", required = true, dataType = "String"),
            @ApiImplicitParam(name = "userName", value = "userName", paramType = "query", required = true, dataType = "String"),
            @ApiImplicitParam(name = "start", value = "start", paramType = "query", required = true, dataType = "String"),
            @ApiImplicitParam(name = "end", value = "end", paramType = "query", required = true, dataType = "String")}
    )
    @RequestMapping(value = "/getGitNum", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
    public Map<String,Object> getGitById(@RequestParam("privateToken") String privateToken,
                                         @RequestParam("userName") String userName,
                                         @RequestParam("start") String start,
                                         @RequestParam("end") String end);

}
